import { API_DOMAINS, http } from '@/http/request/alova'
// 视频分类
export interface CategoryBasic {
  id: number
  name: string
  [key: string]: any
}
// 优惠券
export interface VoucherBasic {
	id: number
	name: string
	price: string
	[key: string]: any
}

// 获取优惠券列表
export function getVoucherList() {
  return http.Get<VoucherBasic[]>('/api/order/voucher', {
    meta: { domain: API_DOMAINS.SECONDARY }, // 用于切换请求地址
  })
}

// 获取订单列表
export function getOrderList(params?: any) {
	return http.Get<Record<string, any>[]>('/api/order/my_order', {
		params,
		meta: { domain: API_DOMAINS.SECONDARY }, // 用于切换请求地址
	})
}

// 订单支付 order_type = 0服务 1补款
export function orderWepay(data: AnyObject) {
	return http.Post<Record<string, any>>('/api/order/wepay', data)
}

// 订单下单
export function submitOrder(data: AnyObject) {
  return http.Post<Record<string, any>>('/api/order/add', data)
}
